package com.vast.vastlcd.dialog;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

public class SWTConnection extends Composite {

	private Label label = null;
	private Label label1 = null;
	public Text pipeName = null;
	public Button pipeRadio = null;
	public Button socketRadio = null;
	public Button checkBox = null;
	private Label label2 = null;
	public Text HostName = null;
	private Label label3 = null;
	public Text Port = null;
	public SWTConnectionDialog dialog = null;
	
	public SWTConnection(SWTConnectionDialog dialog, Composite parent, int style) {
		super(parent, style);
		this.dialog = dialog;
		initialize();
	}
	
	private void initialize() {
		this.setLayout(null);
		setSize(new Point(285, 148));
		label = new Label(this, SWT.NONE);
		label.setBounds(new Rectangle(16, 16, 92, 21));
		label.setText("Connection Type :");
		label1 = new Label(this, SWT.NONE);
		label1.setBounds(new Rectangle(16, 81, 97, 21));
		label1.setText("Pipe Name :");
		pipeName = new Text(this, SWT.BORDER);
		pipeName.setBounds(new Rectangle(117, 82, 150, 21));
		pipeRadio = new Button(this, SWT.RADIO);
		pipeRadio.setBounds(new Rectangle(121, 16, 151, 20));
		pipeRadio.setSelection(true);
		pipeRadio.setText("Named Pipe");
		pipeRadio.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
				label1.setVisible(true);
				pipeName.setVisible(true);
				label2.setVisible(false);
				HostName.setVisible(false);
				label3.setVisible(false);
				Port.setVisible(false);
			}
		});
		socketRadio = new Button(this, SWT.RADIO);
		socketRadio.setBounds(new Rectangle(121, 34, 151, 20));
		socketRadio.setText("Socket");
		socketRadio.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
				label1.setVisible(false);
				pipeName.setVisible(false);
				label2.setVisible(true);
				HostName.setVisible(true);
				label3.setVisible(true);
				Port.setVisible(true);
			}
		});
		checkBox = new Button(this, SWT.CHECK);
		checkBox.setBounds(new Rectangle(16, 57, 127, 18));
		checkBox.setText("Create Connection");
		label2 = new Label(this, SWT.NONE);
		label2.setBounds(new Rectangle(16, 81, 97, 21));
		label2.setVisible(false);
		label2.setText("Host Name :");
		HostName = new Text(this, SWT.BORDER);
		HostName.setBounds(new Rectangle(117, 82, 150, 21));
		HostName.setVisible(false);
		label3 = new Label(this, SWT.NONE);
		label3.setBounds(new Rectangle(16, 112, 97, 21));
		label3.setVisible(false);
		label3.setText("Port :");
		Port = new Text(this, SWT.BORDER);
		Port.setBounds(new Rectangle(117, 113, 150, 21));
		Port.setVisible(false);
	}

}  //  @jve:decl-index=0:visual-constraint="9,9"
